<template>
  <div class="content-block">
    <div class="info-head">{{ title }}</div>
    <div class="info-content">
      <v-chart :option="chartOption" style="width:100%;height:300px;"></v-chart>
    </div>
  </div>
</template>

<script>
export default {
  name: 'pie-chart',
  props: ['title', 'unit'],
  data () {
    return {
      lines: ['进贤县', '安义县', '南昌县', '东湖区', '西湖区', '红谷滩区', '青山湖区', '青云谱区', '新建区']
    }
  },
  computed: {
    chartOption () {
      return {
        tooltip: {
          trigger: 'item'
        },
        series: [
          {
            type: 'pie',
            radius: [40, 100],
            center: ['50%', '50%'],
            roseType: 'area',
            label: {
              color: '#50fdfc'
            },
            itemStyle: {
              borderRadius: 8,
            },
            data: this.lines.map(v => ({
              name: v,
              value: Math.round(Math.random() * 99 + 1)
            }))
          }
        ]
      }
    }
  }
}
</script>

<style scoped>

</style>
